@{
    ViewBag.Title = "管理员登录";
}
@section head{
   <script type="text/javascript">
       var backurl='@Request.QueryString["BackUrl"]';
       $(document).ready(function () {
           $(document.body).keydown(function(event){
               if(event.keyCode==13){
                   $('.login_btn').click();
                   return false;
               }
           });

           $('.login_btn').click(function () {
               ajax_submit('.login_div', undefined, function (r) {
                   if (r.success) {
                       if(backurl!=''){
                           location.href=backurl;
                       }
                       else{
                           window.top.location.href = serverUrl.webRoot + 'Home/Index';
                       }
                   }
                   else {
                       if(r.data==1)  $('#Code').val(null);
                       else{ 
                          $('#Password').val(null);
                          $('#Code').val(null);
                       }
                       $('#imgCode').click();
                   }
               });
           });

           $('#imgCode').click(function () {
               this.src = this.src + '&';
           });

           document.getElementById('RememberId').checked=@ViewBag.Remember.ToString().ToLower();
       });
   </script>
}
@section body{
<body class="mainbody">
<div class="login_div">
	<div class="login_box">
    	<div class="login_logo">LOGO</div>
        <div class="login_content">
          <dl>
			<dt>登录帐号：</dt>
            <dd><input type="text" name="UserName" id="UserName" class="login_input easyui-validatebox imedisable" value="@ViewBag.UserName" data-options="required:true" style="width:130px;text-transform:uppercase;" /></dd>
          </dl>
          <dl>
			<dt>登录密码：</dt>
            <dd><input type="password" name="Password" id="Password" class="login_input easyui-validatebox" data-options="required:true" style="width:130px;" /></dd>
          </dl>
           <dl>
			   <dt>验证码：</dt>
               <dd>
                   <img  id="imgCode" src="@Url.Action("VerifyCode", "Tools", new { key = "login_verify_code" })" width="70" height="22" alt="点击切换验证码" title="点击切换验证码"/>
                   <input type="text" name="Code" id="Code" value="" class="login_input easyui-validatebox imedisable" data-options="required:true" maxlength="4" style="width:55px;text-transform:uppercase;" />
               </dd>
           </dl>
           <div class="login_foot">
              <span class="checkbox_midle"><input type="checkbox" name="Remember" id="RememberId" value="true" checked="checked" /><label for="RememberId">记住用户名</label></span>
              <input type="submit" id="Submit" value="登 录" class="login_btn"  />
		   </div>
        </div>
        <div class="login_tip">
            
        </div>
    </div>
	<div class="login_copyright">Copyright 2009 - 2013 <a href="http://www.cotek.com">www.xxx.com</a> Inc. All Rights Reserved.<br />某某某 版权所有</div>
</div>
</body>
}